package b1.players
{
	public class BattleCaseInfo
	{
		//所属的案件ID
		public var caseId:int;
		//失败动物的ID
		public var loserAnimalId:int;
		//失败动物的所有者ID
		public var loserOwnerId:int;
		//失败动物的所有者的名字
		public var loserOwnerName:String;
		//涉案的骨头数
		public var caseBones:int;
		//所有的线索
		public var clues:Array;
		//受害者本人侦探标志位
		public var ownerDetectedFlag:Boolean;
		//其他人侦探标志位
		public var otherDetectedFlag:Boolean;
		//传家骨的原始拥有者
		public var loseHeirloomId:int;
		//破案者用户id
		public var detectiveOwnerId:int;
		//破案者用户名字
		public var detectiveOwnerName:String;
		
		public function BattleCaseInfo(caseXML:XML = null)
		{
			if (caseXML != null)
			{
				this.caseId = parseInt(caseXML.caseId);
				this.loserAnimalId = parseInt(caseXML.loserAnimalId);
				this.loserOwnerId = parseInt(caseXML.loserOwnerId);
				this.loserOwnerName = caseXML.loserOwnerName;
				this.caseBones = parseInt(caseXML.caseBones);
				this.ownerDetectedFlag = Boolean(parseInt(caseXML.ownerDetectedFlag));
				this.otherDetectedFlag = Boolean(parseInt(caseXML.otherDetectedFlag));
				this.loseHeirloomId = parseInt(caseXML.loseHeirloomId);
				this.detectiveOwnerId = parseInt(caseXML.detectiveOwnerId);
				this.detectiveOwnerName = caseXML.detectiveOwnerName;
			}
			this.clues = new Array();
		}
		
		public function getCaseName():String
		{
			var caseName:String;
			if (loseHeirloomId > 0)
			{
				caseName = "传家骨失窃案件";
			}
			else
			{
				if (caseBones > 200)
				{
					caseName = "重型失窃案件";
				}
				else if (caseBones > 100)
				{
					caseName = "大型失窃案件";
				}
				else
				{
					caseName = "小型失窃案件";
				}
			}
			return caseName;
		}
	}
}